package com.domain.duinocontrolmotor.model;

import android.os.Bundle;
import android.os.Handler;
import android.os.Message;

public class ThreadDef extends Thread {
	  private Handler handler; 
	  private int i = 0;
	  
	  public ThreadDef(Handler handler){
		  this.handler = handler; 
	  }
	  
	  public void run() {
	 
 		  try{
 		  while(true) {    
 				  notifyMessage("Secondi "+i); 
 				  Thread.sleep(1000);       
 				  i++;  
 		  }
 		  }catch(InterruptedException ex) {} 
	  }
	  
 	  private void notifyMessage(String str) {    
 		  Message msg = handler.obtainMessage();   
	
		  handler.sendMessage(msg);  
	  }

}

 
